A storage server is a special purpose processing system used to store and retrieve data on behalf of one or more clients locally or over a network. A storage server operates on behalf of the one or more clients to store and manage shared data in a set of mass storage devices, such as magnetic or optical storage-based disks or tapes. A conventional storage server includes a storage operating system that implements a file system to logically organize data as a hierarchical structure of directories and files on the disks. A file system is any organization of data in a structured manner, which can be, but is not necessarily, organized in terms of a structured (e.g., hierarchical) set of stored files, directories and/or other types of data containers. Data stored by a storage server may be stored in the form of multiple blocks that each contains data. A block is the basic unit used by a file system in a storage server to manipulate and transfer data and/or metadata.
Directory quota is an ability to set a file and/or disk block (storage) usage limit on a per directory basis, e.g., a limit on the usage by a particular user or a group for all files and sub-directories that reside under a given directory. The quota directory is not limited to being a directory at the root level of the file system (i.e. a directory under “/”), it can be at any level. As shown in FIG. 1, the directory quota need not to be set at dirt, it can be set at any level below or above dirt.
Directory quotas can be set on multiple directories which may or may not be nested. Nested directory quota refers to the situation where a directory quota is set on a directory and one or more of its parents (immediate or several levels up) also have directory quotas set on them. For a non-limiting example, if directory quotas are set for dir2 and dir4 in FIG. 1, these directory quotas form nested directory quotas and all files under dir4 need to be accounted for in the directory quota of dir2 as well as of dir4.
Common Internet File System (CIFS) is a standard protocol that lets clients make requests for files and services on remote computers on the Internet. CIFS uses the client/server programming model under which client program running on a host makes a request of a server (usually another host) for access to a file or to pass a message to a program that runs on the server and the server takes the request and returns a response. CIFS allows the client to get access to files that are local to the server and read and write to them, share files with other clients using special locks, and restore connections automatically in case of network failure. CIFS runs at a higher level than and uses the Internet's TCP/IP protocol and it is a complement to the existing Internet application protocols such as the File Transfer Protocol (FTP) and the Hypertext Transfer Protocol (HTTP). It provides a potentially more direct interface to server programs than currently available through the Web browser and its use of the HTTP protocol.
Maintaining directory quotas is relatively simple for CIFS since CIFS is a stateful protocol (in which part of the data that is exchanged between the client and the server includes state information) and file accesses happen via a file descriptor which is established via a call to the server using file names, so it is easy to track the file name in the handle of the call on the server. Further CIFS does not have a notion of a hard link, which is a reference, or pointer, to physical data on a storage volume, making the problem much simpler. The lack of hard links also makes the problem easier to solve on local Windows file systems.
Network File System (NFS) is a client/server protocol that lets a computer user view and optionally store and update files on a remote host as though the files were on the user's own host. The user's host needs to have an NFS client and the remote host needs to have an NFS server. Both the NFS server and client use TCP/IP and or UDP to transmit the files and updates back and forth. Using NFS, the user or a system administrator can mount all or a portion of a file system, making the mounted portion of the file system accessible by a user with access privileges, such as read-only or read-write, to each file.
Maintaining directory quotas for NFS (either in an NFS only environment or in a mixed environment) is difficult since NFS is a stateless protocol (in which neither the client nor the server has an obligation to keep track of the state information) and an operation on a file are done using file handles which are persistent identifiers for the file. Moreover, NFS has a notion of hard links which makes it possible for the file to have multiple parent directories, which makes directory quota implementations difficult since the server must have mechanisms to find all parent directories (i.e. all ancestors) of the file given the file's file handle, as any of the ancestors may have a directory quota set on them. This quota needs to be updated and verified before the file operation can complete. The existence of hard links also makes the problem much harder to solve for local file systems on most UNIX platforms because most UNIX file systems only have the ability to go from a directory to its parent directory, not the ability to go from the file to its parents.